package com.atguigu.agent.tools;

import dev.langchain4j.agent.tool.Tool;
import dev.langchain4j.agent.tool.ToolMemoryId;
import org.springframework.stereotype.Component;

@Component
public class CalculatorTools {
    //注意类名，方法名要意思清晰，这样大模型可以知道

    @Tool
    double sum(
            @ToolMemoryId int memoryId,
            double a, double b) {
        System.out.println("调用加法运算memoryId"+memoryId);
        return a + b;
    }
    @Tool
    double squareRoot(
            @ToolMemoryId int memoryId,
            double x) {
        System.out.println("调用平方根运算memoryId"+memoryId);
        return Math.sqrt(x);
    }

}
